<!DOCTYPE HTML PUBLIC "-//ORA//DTD CD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>[Chapter 13] The java.lang.reflect Package</TITLE>
<META NAME="author" CONTENT="Mark Grand and Jonathan Knudsen">
<META NAME="date" CONTENT="Fri Aug  8 17:12:26 1997">
<META NAME="form" CONTENT="html">
<META NAME="metadata" CONTENT="dublincore.0.1">
<META NAME="objecttype" CONTENT="book part">
<META NAME="otheragent" CONTENT="gmat dbtohtml">
<META NAME="publisher" CONTENT="O'Reilly &amp; Associates, Inc.">
<META NAME="source" CONTENT="SGML">
<META NAME="subject" CONTENT="Java">
<META NAME="title" CONTENT="Java Fundamental Classes Reference">
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">
</HEAD>
<body vlink="#551a8b" alink="#ff0000" text="#000000" bgcolor="#FFFFFF" link="#0000ee">

<DIV CLASS=htmlnav>
<H1><a href='index.htm'><IMG SRC="gifs/smbanner.gif"
     ALT="Java Fundamental Classes Reference" border=0></a></H1>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch12_69.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><B><FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1">Chapter 13</FONT></B></TD>
<td width=172 align=right valign=top><A HREF="ch13_02.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
</table>

&nbsp;
<hr align=left width=515>
</DIV>
<H1 CLASS=chapter><A CLASS="TITLE" NAME="JFC-CH-13">13. The java.lang.reflect Package</A></H1>

<DIV CLASS=htmltoc>

<p>
<b>Contents:</b><br>
Array<br>
<A HREF="ch13_02.htm">Constructor</A><BR>
<A HREF="ch13_03.htm">Field</A><BR>
<A HREF="ch13_04.htm">InvocationTargetException</A><BR>
<A HREF="ch13_05.htm">Member</A><BR>
<A HREF="ch13_06.htm">Method</A><BR>
<A HREF="ch13_07.htm">Modifier</A><BR>

<p>
</DIV>

<P CLASS=para>
The package <tt CLASS=literal>java.lang.reflect</tt> is new as
of Java 1.1.  It contains 
classes and interfaces that support the Reflection API.
Reflection refers to the ability of a class to reflect upon itself,
or look inside of itself, to see what it can do.
The Reflection API makes it possible to:

<P>
<UL CLASS=itemizedlist>
<li CLASS=listitem>Discover the variables, methods, and constructors of any class.

<P>
<li CLASS=listitem>Create an instance of any class using any available constructor of 
that class, even if the class initiating the creation was not 
compiled with any information about the class to be instantiated.

<P>
<li CLASS=listitem>Access the variables of any object, even if the accessing class was not 
compiled with any information about the class to be accessed.

<P>
<li CLASS=listitem>Call the methods of any object, even if the calling class was not 
compiled with any information about the class that contains the methods.

<P>
<li CLASS=listitem>Create an array of objects that are instances of any class, even if
the creating class was not compiled with any information about the
class.

<P>
</UL>
<P CLASS=para>
These capabilities are implemented by the 
<tt CLASS=literal>java.lang.Class</tt> class and the classes in the 
<tt CLASS=literal>java.lang.reflect</tt> package.  
<A HREF="ch13_01.htm#JFC-CH-13-FIG-1">Figure 13.1</A> shows the class hierarchy for
the <tt CLASS=literal>java.lang.reflect</tt> package.

<DIV CLASS=figure>
<h4 CLASS=figure><A CLASS="TITLE" NAME="JFC-CH-13-FIG-1">Figure 13.1: The java.lang.reflect package</A></h4>


<p>
<img align=middle src="./figs/jfc_1301.gif" alt="[Graphic: Figure 13-1]" width=502 height=263 border=0>

</DIV>

<P CLASS=para>
Java 1.1 currently uses the Reflection API for two purposes:

<P>
<UL CLASS=itemizedlist>
<li CLASS=listitem>The JavaBeans API supports a mechanism for customizing
objects that is based on being able to discover their public
variables, methods, and constructors.  See the forthcoming
<I CLASS=emphasis>Developing Java Beans</I> from O'Reilly &amp; Associates
for more information about the JavaBeans API.

<P>
<li CLASS=listitem>The object serialization functionality in <tt CLASS=literal>java.io</tt>
is built on top of the Reflection API.  
Object serialization allows arbitrary objects to be written
to a stream of bytes and then read back later as objects.

<P>
</UL>
<DIV CLASS=refnamediv>
<H1>Array</H1>

<H2>Name</H2>

Array

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch13-REFSECT1-AUTOID.1">Synopsis</A></h2>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Class Name:<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>java.lang.reflect.Array</tt>

<p>
<DT CLASS=varlistentry>Superclass:<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>java.lang.Object</tt>

<p>
<DT CLASS=varlistentry>Immediate Subclasses:<br>
<DD>

<P CLASS=para>
None

<p>
<DT CLASS=varlistentry>Interfaces Implemented:<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>java.lang.Cloneable</tt>, 
<tt CLASS=literal>java.io.Serializable</tt>

<p>
<DT CLASS=varlistentry>Availability:<br>
<DD>

<P CLASS=para>
New as of JDK 1.1 </DL>
</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch13-REFSECT1-AUTOID.2">Description</A></h2>

<P CLASS=para>
The <tt CLASS=literal>Array</tt> 
class provides static methods to manipulate arbitrary 
arrays in Java. 
There are methods to set and retrieve elements in an array, determine the 
size of an array, and create a new instance of an array. 

<P CLASS=para>
The <tt CLASS=literal>Array</tt> 
class is used to create array objects and 
manipulate their elements. The <tt CLASS=literal>Array</tt> class is not
used to represent array types. Because arrays 
in Java are objects, array 
types are represented by <tt CLASS=literal>Class</tt> 
objects. 

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch13-REFSECT1-AUTOID.3">Class Summary</A></h2>

<DIV CLASS=screen>
<P>
<PRE>
public final class java.lang.reflect.Array extends java.lang.Object {
  // Class Methods
  public static native Object get(Object array, int index);
  public static native boolean getBoolean(Object array, int index);
  public static native byte getByte(Object array, int index);
  public static native char getChar(Object array, int index);
  public static native double getDouble(Object array, int index);
  public static native float getFloat(Object array, int index);
  public static native int getInt(Object array, int index);
  public static native int getLength(Object array);
  public static native long getLong(Object array, int index);
  public static native short getShort(Object array, int index);
  public static Object newInstance(Class componentType, int length);
  public static Object newInstance(Class componentType, int[] dimensions);
  public static native void set(Object array, int index, Object value);
  public static native void setBoolean(Object array, int index, boolean z);
  public static native void setByte(Object array, int index, byte b);
  public static native void setChar(Object array, int index, char c);
  public static native void setDouble(Object array, int index, double d);
  public static native void setFloat(Object array, int index, float f);
  public static native void setInt(Object array, int index, int i);
  public static native void setLong(Object array, int index, long l);
  public static native void setShort(Object array, int index, short s);
}
</PRE>
</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch13-REFSECT1-AUTOID.4">Class Methods</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch13-REFSECT2-AUTOID.1">get</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch13-REFSECT3-AUTOID.1"><DIV CLASS=screen> <P> <PRE> public static native Object get(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>array</tt><br>
<DD>

<P CLASS=para>
An array object.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>index</tt><br>
<DD>

<P CLASS=para>
An index into the array. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The object at the given index in the specified array. 

<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IllegalArgumentException</tt><br>
<DD>

<P CLASS=para>
If the given object is not an array.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If the given index is invalid.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NullPointerException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>array</tt> is <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns the object at the given index in the array. If the 
array contains values of a primitive type, the value at the given index 
is wrapped in an appropriate object, and the object is returned. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch13-REFSECT2-AUTOID.2">getBoolean</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch13-REFSECT3-AUTOID.2"><DIV CLASS=screen> <P> <PRE> public static native boolean getBoolean(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>array</tt><br>
<DD>

<P CLASS=para>
An array object.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>index</tt><br>
<DD>

<P CLASS=para>
An index into the array. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>boolean</tt> value at the given 
index in the specified array. 

<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IllegalArgumentException</tt><br>
<DD>

<P CLASS=para>
If the given object is not an array, or the object at the given index cannot 
be converted to a <tt CLASS=literal>boolean</tt>.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If the given index is invalid.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NullPointerException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>array</tt> is <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns the object at the given index in the array as a <tt CLASS=literal>boolean</tt> 
value. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch13-REFSECT2-AUTOID.3">getByte</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch13-REFSECT3-AUTOID.3"><DIV CLASS=screen> <P> <PRE> public static native byte getByte(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>array</tt><br>
<DD>

<P CLASS=para>
An array object.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>index</tt><br>
<DD>

<P CLASS=para>
An index into the array. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>byte</tt> value at the given 
index in the specified array. 

<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IllegalArgumentException</tt><br>
<DD>

<P CLASS=para>
If the given object is not an array, or the object at the given index cannot 
be converted to a <tt CLASS=literal>byte</tt>.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If the given index is invalid.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NullPointerException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>array</tt> is <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns the object at the given index in the array as a <tt CLASS=literal>byte</tt> 
value. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch13-REFSECT2-AUTOID.4">getChar</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch13-REFSECT3-AUTOID.4"><DIV CLASS=screen> <P> <PRE> public static native char getChar(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>array</tt><br>
<DD>

<P CLASS=para>
An array object.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>index</tt><br>
<DD>

<P CLASS=para>
An index into the array. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>char</tt> value at the given 
index in the specified array. 

<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IllegalArgumentException</tt><br>
<DD>

<P CLASS=para>
If the given object is not an array, or the object at the given index cannot 
be converted to a <tt CLASS=literal>char</tt>.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If the given index is invalid.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NullPointerException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>array</tt> is <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns the object at the given index in the array as a <tt CLASS=literal>char</tt> 
value. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch13-REFSECT2-AUTOID.5">getDouble</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch13-REFSECT3-AUTOID.5"><DIV CLASS=screen> <P> <PRE> public static native double getDouble(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>array</tt><br>
<DD>

<P CLASS=para>
An array object.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>index</tt><br>
<DD>

<P CLASS=para>
An index into the array. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>double</tt> value at the given 
index in the specified array. 

<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IllegalArgumentException</tt><br>
<DD>

<P CLASS=para>
If the given object is not an array, or the object at the given index cannot 
be converted to a <tt CLASS=literal>double</tt>.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If the given index is invalid.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NullPointerException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>array</tt> is <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns the object at the given index in the array as a <tt CLASS=literal>double</tt> 
value. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch13-REFSECT2-AUTOID.6">getFloat</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch13-REFSECT3-AUTOID.6"><DIV CLASS=screen> <P> <PRE> public static native float getFloat(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>array</tt><br>
<DD>

<P CLASS=para>
An array object.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>index</tt><br>
<DD>

<P CLASS=para>
An index into the array. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>float</tt> value at the given 
index in the specified array. 

<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IllegalArgumentException</tt><br>
<DD>

<P CLASS=para>
If the given object is not an array, or the object at the given index cannot 
be converted to a <tt CLASS=literal>float</tt>.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If the given index is invalid.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NullPointerException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>array</tt> is <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns the object at the given index in the array as a <tt CLASS=literal>float</tt> 
value. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch13-REFSECT2-AUTOID.7">getInt</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch13-REFSECT3-AUTOID.7"><DIV CLASS=screen> <P> <PRE> public static native int getInt(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>array</tt><br>
<DD>

<P CLASS=para>
An array object.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>index</tt><br>
<DD>

<P CLASS=para>
An index into the array. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>int</tt> value at the given 
index in the specified array. 

<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IllegalArgumentException</tt><br>
<DD>

<P CLASS=para>
If the given object is not an array, or the object at the given index cannot 
be converted to a <tt CLASS=literal>int</tt>.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If the given index is invalid.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NullPointerException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>array</tt> is <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns the object at the given index in the array as a <tt CLASS=literal>int</tt> 
value. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch13-REFSECT2-AUTOID.8">getLength</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch13-REFSECT3-AUTOID.8"><DIV CLASS=screen> <P> <PRE> public static native int getLength(Object array) throws IllegalArgumentException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>array</tt><br>
<DD>

<P CLASS=para>
An array object. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The length of the specified array. 

<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IllegalArgumentException</tt><br>
<DD>

<P CLASS=para>
If the given object is not an array. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns the length of the array. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch13-REFSECT2-AUTOID.9">getLong</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch13-REFSECT3-AUTOID.9"><DIV CLASS=screen> <P> <PRE> public static native long getLong(Object array, long index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>array</tt><br>
<DD>

<P CLASS=para>
An array object.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>index</tt><br>
<DD>

<P CLASS=para>
An index into the array. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>long</tt> value at the given 
index in the specified array. 

<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IllegalArgumentException</tt><br>
<DD>

<P CLASS=para>
If the given object is not an array, or the object at the given index cannot 
be converted to a <tt CLASS=literal>long</tt>.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If the given index is invalid.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NullPointerException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>array</tt> is <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns the object at the given index in the array as a <tt CLASS=literal>long</tt> 
value. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch13-REFSECT2-AUTOID.10">getShort</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch13-REFSECT3-AUTOID.10"><DIV CLASS=screen> <P> <PRE> public static native short getShort(Object array, short index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>array</tt><br>
<DD>

<P CLASS=para>
An array object.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>index</tt><br>
<DD>

<P CLASS=para>
An index into the array. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>short</tt> value at the given 
index in the specified array. 

<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IllegalArgumentException</tt><br>
<DD>

<P CLASS=para>
If the given object is not an array, or the object at the given index cannot 
be converted to a <tt CLASS=literal>short</tt>.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If the given index is invalid.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NullPointerException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>array</tt> is <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method returns the object at the given index in the array as a <tt CLASS=literal>short</tt> 
value. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch13-REFSECT2-AUTOID.11">newInstance</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch13-REFSECT3-AUTOID.11"><DIV CLASS=screen> <P> <PRE> public static Object newInstance(Class componentType, int length) throws NegativeArraySizeException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>componentType</tt><br>
<DD>

<P CLASS=para>
The type of each element in the array.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>length</tt><br>
<DD>

<P CLASS=para>
The length of the array. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
An array object that contains elements of the given component type and 
has the specified length. 

<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>NegativeArraySizeException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>length</tt> is negative.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NullPointerException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>componentType</tt> is <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method creates a single-dimension array with the given length and 
component type. </DL>
</DIV>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch13-REFSECT3-AUTOID.12"><DIV CLASS=screen> <P> <PRE> public static Object newInstance(Class componentType, int[] dimensions) throws IllegalArgumentException, NegativeArraySizeException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>componentType</tt><br>
<DD>

<P CLASS=para>
The type of each element in the array.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>dimensions</tt><br>
<DD>

<P CLASS=para>
An array that 
specifies the dimensions of the array to be created. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
An array object that contains elements of the given component type and 
has the specified number of dimensions. 

<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IllegalArgumentException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>dimensions</tt> has zero dimensions 
itself, or if it has too many dimensions (typically 255 array dimensions 
are supported).

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NegativeArraySizeException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>length</tt> is negative.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NullPointerException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>componentType</tt> is <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method creates a multidimensional array with the given dimensions 
and component type. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch13-REFSECT2-AUTOID.12">set</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch13-REFSECT3-AUTOID.13"><DIV CLASS=screen> <P> <PRE> public static native void set(Object array, int index, Object value) throws IllegalArgumentException, ArrayIndexOutOfBoundsException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>array</tt><br>
<DD>

<P CLASS=para>
An array object.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>index</tt><br>
<DD>

<P CLASS=para>
An index into the array.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>value</tt><br>
<DD>

<P CLASS=para>
The new value. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IllegalArgumentException</tt><br>
<DD>

<P CLASS=para>
If the given object is not an array, or if it represents an array of primitive 
values, and the given value cannot be unwrapped and converted to that primitive 
type.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If the given index is invalid.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NullPointerException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>array</tt> is <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method sets the object at the given index in the array to the specified 
value. If the array contains values of a primitive type, the given value 
is automatically unwrapped before it is put in the array. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch13-REFSECT2-AUTOID.13">setBoolean</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch13-REFSECT3-AUTOID.14"><DIV CLASS=screen> <P> <PRE> public static native void setBoolean(Object array, int index, boolean z) throws IllegalArgumentException, ArrayIndexOutOfBoundsException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>array</tt><br>
<DD>

<P CLASS=para>
An array object.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>index</tt><br>
<DD>

<P CLASS=para>
An index into the array.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>z</tt><br>
<DD>

<P CLASS=para>
The new value. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IllegalArgumentException</tt><br>
<DD>

<P CLASS=para>
If the given object is not an array, or if the given value cannot be converted 
to the component type of the array.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If the given index is invalid.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NullPointerException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>array</tt> is <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method sets the element at the given index in the array to the given 
<tt CLASS=literal>boolean</tt> value. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch13-REFSECT2-AUTOID.14">setByte</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch13-REFSECT3-AUTOID.15"><DIV CLASS=screen> <P> <PRE> public static native void setByte(Object array, int index, byte b) throws IllegalArgumentException, ArrayIndexOutOfBoundsException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>array</tt><br>
<DD>

<P CLASS=para>
An array object.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>index</tt><br>
<DD>

<P CLASS=para>
An index into the array.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>b</tt><br>
<DD>

<P CLASS=para>
The new value. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IllegalArgumentException</tt><br>
<DD>

<P CLASS=para>
If the given object is not an array, or if the given value cannot be converted 
to the component type of the array.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If the given index is invalid.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NullPointerException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>array</tt> is <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method sets the element at the given index in the array to the given 
<tt CLASS=literal>byte</tt> value. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch13-REFSECT2-AUTOID.15">setChar</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch13-REFSECT3-AUTOID.16"><DIV CLASS=screen> <P> <PRE> public static native void setChar(Object array, int index, char c) throws IllegalArgumentException, ArrayIndexOutOfBoundsException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>array</tt><br>
<DD>

<P CLASS=para>
An array object.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>index</tt><br>
<DD>

<P CLASS=para>
An index into the array.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>c</tt><br>
<DD>

<P CLASS=para>
The new value. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IllegalArgumentException</tt><br>
<DD>

<P CLASS=para>
If the given object is not an array, or if the given value cannot be converted 
to the component type of the array.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If the given index is invalid.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NullPointerException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>array</tt> is <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method sets the element at the given index in the array to the given 
<tt CLASS=literal>char</tt> value. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch13-REFSECT2-AUTOID.16">setDouble</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch13-REFSECT3-AUTOID.17"><DIV CLASS=screen> <P> <PRE> public static native void setDouble(Object array, int index, double d) throws IllegalArgumentException, ArrayIndexOutOfBoundsException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>array</tt><br>
<DD>

<P CLASS=para>
An array object.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>index</tt><br>
<DD>

<P CLASS=para>
An index into the array.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>d</tt><br>
<DD>

<P CLASS=para>
The new value. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IllegalArgumentException</tt><br>
<DD>

<P CLASS=para>
If the given object is not an array, or if the given value cannot be converted 
to the component type of the array.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If the given index is invalid.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NullPointerException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>array</tt> is <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method sets the element at the given index in the array to the given 
<tt CLASS=literal>double</tt> value. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch13-REFSECT2-AUTOID.17">setFloat</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch13-REFSECT3-AUTOID.18"><DIV CLASS=screen> <P> <PRE> public static native void setFloat(Object array, int index, float f) throws IllegalArgumentException, ArrayIndexOutOfBoundsException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>array</tt><br>
<DD>

<P CLASS=para>
An array object.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>index</tt><br>
<DD>

<P CLASS=para>
An index into the array.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>f</tt><br>
<DD>

<P CLASS=para>
The new value. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IllegalArgumentException</tt><br>
<DD>

<P CLASS=para>
If the given object is not an array, or if the given value cannot be converted 
to the component type of the array.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If the given index is invalid.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NullPointerException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>array</tt> is <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method sets the element at the given index in the array to the given 
<tt CLASS=literal>float</tt> value. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch13-REFSECT2-AUTOID.18">setInt</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch13-REFSECT3-AUTOID.19"><DIV CLASS=screen> <P> <PRE> public static native void setInt(Object array, int index, int i) throws IllegalArgumentException, ArrayIndexOutOfBoundsException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>array</tt><br>
<DD>

<P CLASS=para>
An array object.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>index</tt><br>
<DD>

<P CLASS=para>
An index into the array.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>i</tt><br>
<DD>

<P CLASS=para>
The new value. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IllegalArgumentException</tt><br>
<DD>

<P CLASS=para>
If the given object is not an array, or if the given value cannot be converted 
to the component type of the array.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If the given index is invalid.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NullPointerException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>array</tt> is <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method sets the element at the given index in the array to the given 
<tt CLASS=literal>int</tt> value. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch13-REFSECT2-AUTOID.19">setLong</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch13-REFSECT3-AUTOID.20"><DIV CLASS=screen> <P> <PRE> public static native void setLong(Object array, int index, long l) throws IllegalArgumentException, ArrayIndexOutOfBoundsException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>array</tt><br>
<DD>

<P CLASS=para>
An array object.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>index</tt><br>
<DD>

<P CLASS=para>
An index into the array.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>l</tt><br>
<DD>

<P CLASS=para>
The new value. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IllegalArgumentException</tt><br>
<DD>

<P CLASS=para>
If the given object is not an array, or if the given value cannot be converted 
to the component type of the array.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If the given index is invalid.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NullPointerException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>array</tt> is <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method sets the element at the given index in the array to the given 
<tt CLASS=literal>long</tt> value. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch13-REFSECT2-AUTOID.20">setShort</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch13-REFSECT3-AUTOID.21"><DIV CLASS=screen> <P> <PRE> public static native void setShort(Object array, int index, short s) throws IllegalArgumentException, ArrayIndexOutOfBoundsException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>array</tt><br>
<DD>

<P CLASS=para>
An array object.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>index</tt><br>
<DD>

<P CLASS=para>
An index into the array.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>s</tt><br>
<DD>

<P CLASS=para>
The new value. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IllegalArgumentException</tt><br>
<DD>

<P CLASS=para>
If the given object is not an array, or if the given value cannot be converted 
to the component type of the array.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>ArrayIndexOutOfBoundsException</tt><br>
<DD>

<P CLASS=para>
If the given index is invalid.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NullPointerException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>array</tt> is <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method sets the element at the given index in the array to the given 
<tt CLASS=literal>short</tt> value. </DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch13-REFSECT1-AUTOID.5">Inherited Methods</A></h2>

<DIV CLASS=informaltable>
<P>
<TABLE CLASS=INFORMALTABLE>
<TR CLASS=row>
<TH ALIGN="LEFT">

<P CLASS=para>
Method</TH>
<TH ALIGN="LEFT">

<P CLASS=para>
Inherited From</TH>
<TH ALIGN="LEFT">

<P CLASS=para>
Method</TH>
<TH ALIGN="LEFT">

<P CLASS=para>
Inherited From</TH>
</TR>
<TR CLASS=row>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>clone()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>equals(Object)</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>finalize()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>getClass()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>hashCode()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>notify()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>notifyAll()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>toString()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>wait()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>wait(long)</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>wait(long, int)</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="LEFT">&nbsp;</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
</TR>
</TABLE>
<P>
</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch13-REFSECT1-AUTOID.6">See Also</A></h2>

<P CLASS=para>
<tt CLASS=literal>ArrayIndexOutOfBoundsException</tt>, 
<tt CLASS=literal>Class</tt>, 
<tt CLASS=literal>IllegalArgumentException</tt>, 
<tt CLASS=literal>NegativeArraySizeException</tt>, 
<tt CLASS=literal>NullPointerException</tt>, 
<tt CLASS=literal>Object</tt> 
</DIV>


<DIV CLASS=htmlnav>

<P>
<HR align=left width=515>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch12_69.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><a href="index.htm"><img src='gifs/txthome.gif' border=0 alt='Home'></a></td>
<td width=172 align=right valign=top><A HREF="ch13_02.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
<tr>
<td width=172 align=left valign=top>Void</td>
<td width=171 align=center valign=top><a href="index/idx_0.htm"><img src='gifs/index.gif' alt='Book Index' border=0></a></td>
<td width=172 align=right valign=top>Constructor</td>
</tr>
</table>
<hr align=left width=515>

<IMG SRC="gifs/smnavbar.gif" USEMAP="#map" BORDER=0> 
<MAP NAME="map"> 
<AREA SHAPE=RECT COORDS="0,0,108,15" HREF="../javanut/index.htm"
alt="Java in a Nutshell"> 
<AREA SHAPE=RECT COORDS="109,0,200,15" HREF="../langref/index.htm" 
alt="Java Language Reference"> 
<AREA SHAPE=RECT COORDS="203,0,290,15" HREF="../awt/index.htm" 
alt="Java AWT"> 
<AREA SHAPE=RECT COORDS="291,0,419,15" HREF="../fclass/index.htm" 
alt="Java Fundamental Classes"> 
<AREA SHAPE=RECT COORDS="421,0,514,15" HREF="../exp/index.htm" 
alt="Exploring Java"> 
</MAP>
</DIV>

</BODY>
</HTML>
